home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Disc to the Future 2
/
Disc to the Future Part II Programmer's Reference (Wayzata Technology)(6013)(1992).bin
/
MAC
/
THINKC
/
4_0
/
TIFF_WIN
/
ACTIVATE.C
< prev
next >
Wrap
C/C++ Source or Header
|
1990-03-20
|
1KB
|
42 lines
#include "my color.h"
do_activate(an_event)
EventRecord *an_event;
{
CWindowPeek peek;
ControlHandle control;
peek = (CWindowPeek)an_event->message;
if (an_event->modifiers & 01)
{ /*application window is becoming active*/
SetPort((CGrafPtr)an_event->message);
SelectWindow((CWindowPtr)an_event->message);
EnableItem (myMenus[fileM],closeItem);
DisableItem(myMenus[editM],undoItem);
control = peek->controlList;
while(control)
{
ShowControl(control);
control = (*control)->nextControl;
}
DrawGrowIcon((CWindowPtr)an_event->message);
} /*if an_event->modifiers*/
else /*application window is becoming inactive*/
{
if (((CWindowPeek)FrontWindow())->windowKind > 0)
{
control = peek->controlList;
while(control)
{
HideControl(control);
control = (*control)->nextControl;
}
DrawGrowIcon((CWindowPtr)an_event->message);
EnableItem (myMenus[editM], undoItem);
scrapErr = ZeroScrap();
}/*if WindowPeek*/
else
DisableItem (myMenus[editM], undoItem);
} /*else*/
}